﻿using Microsoft.Xna.Framework;
using System;

namespace BattleFury.Lib.Logs
{
	public class LogMessage
	{
		public string Message { get; set; }
		public LogMessageType Type { get; set; }
		public Color Color { get; set; }

		public LogMessage()
		{
			Message = String.Empty;
			Type = LogMessageType.Message;
			Color = GetTypeColor(Type);
		}

		public LogMessage(LogMessageType type, string message)
		{
			Message = message;
			Type = type;
			Color = GetTypeColor(Type);
		}

		public LogMessage(LogMessageType type, Color color, string message)
		{
			Message = message;
			Type = type;
			Color = color;
		}

		public static Color GetTypeColor(LogMessageType type)
		{
			switch (type)
			{
				case LogMessageType.Message: return Color.White;
				case LogMessageType.Info: return Color.LightBlue;
				case LogMessageType.Warning: return Color.LightYellow;
				case LogMessageType.Error: return Color.Crimson;
				default: return Color.White;
			}
		}
	}
}